package com.itcm.purchase.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itcm.purchase.entity.PurchaseOrder;
import com.itcm.purchase.mapper.PurchaseOrderMapper;
import com.itcm.purchase.service.PurchaseOrderService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author cm_fighting
 * @since 2020-07-28
 */
@Service
public class PurchaseOrderServiceImpl extends ServiceImpl<PurchaseOrderMapper, PurchaseOrder> implements PurchaseOrderService {

    @Override
    public void listPage(Page<PurchaseOrder> pageOrder, String orderDate) {
        QueryWrapper<PurchaseOrder> queryWrapper = new QueryWrapper<>();
        if (null != orderDate) {
            queryWrapper.eq("order_date", orderDate);
        }
        this.baseMapper.selectPage(pageOrder, queryWrapper);
    }

    @Override
    public List<String> listName() {
        return this.baseMapper.listName();
    }
}
